The picture on the right shows the mIRC Scripts Editor.
It's in the Aliases editing mode. The other modes are Popups, Remotes, Users and Variables. You change the mode by clicking on the corresponding Tabs. I'll be using the words work space, panel and editing mode interchangeably.
Many script files can be loaded onto the editor at a given time. For example: 3 Alias scripts, 2 Popup scripts and 5 Remote scripts. Now how do you edit the files individually?
Click on View and select the script you wanna edit. Make sure you are in the proper edit mode or you won't find your files. Writing a script in the wrong mode will make your script not function at all. You should be in the correct mode - look at the active tab.
The picture on the right shows the View menu. It's in the Remote edit mode. You can observe: 5 files are loaded and spmail.mrc is the currently the active file in the edit mode. So you get the idea.
To create a new script file you click on File>New. To load a file, File>Load. If you have ever used NotePad you should get the logic of how things work. The File commands are similar. Only make sure when you click Unload, the intended script file is selected in the editor. It's a common mistake which happens esp if you are in a hurry. You often end up unloading the wrong file. As a newbie you should take special care.
Now a brief introduction about Aliases, Popups and Remote. Wondering why I didn't include User and Variables? Because they contain values to be usually created and used by the 'active' scripts (Aliases, Popups and Remote). I never use Users, I find it boring =:) It's just my personal preference and scripting style. You can definitely do without it. Variables, you don't usually write a special Variables file. Maybe some people do. But I don't. I create the variables from the scripts itself. If I have to use a lot of Variable values I usually use an INI file. You can forget about all these for now. Just remember it's the Alias, Popup and Remote which you use to create mIRC script files. Now let's take a look what they are.
Aliases:
Typing /j #channel makes you join #channel. /op NickName will set NickName mode +o. Type /p #channel and you part the channel #chanel. They are examples of Aliases. Let's say you have a robot called CleaningLady. When you whistle Am she closes the windows. When you whistle G# she closes the door. When you whistle F she brings you a can of beer and plays 'The Party Song' by Blink-182. Now, you see you have used whistle notes to invoke predefined actions which would have otherwise taken you more than one word to express your will. Aliases have a similar function, they help you customize your short-cuts (or long-cuts if you are not very bright) for mIRC commands. You didn't have to type /join #channel or /part #channel or /mode #channel +o NickName, which are the actual mIRC commands. We'll see more about Aliases in the Chapter on Aliases.
Popups:
That's what a Popup is, the picture at the right. You get that particular one when you right click in the query window (private message window). Aliases and Popups are very similar in function. Popups too are used to create (clickable) shortcuts. In Aliases you had to know the alias you created to envoke it. In Popups you are presented with the shortcuts you created when you RightClick the mouse. Analogy: You have a poster in your room with many words listed on it. When you point on "Pizza" CleaningLady brings you a Pizza. When you point on "Pizza-o" she cleans up all the Pizza mess you created on your table. When you point on "Pizza-p" she brings you a Pizza and a Pepsi. See, you save a lot of time and energy by not having to explain CleaningLady in detail again and again what you want. Popups are often used to call (envoke) the aliases you created. We'll see more about Popups in the Popups chapter.
Remote:
This is the ultimate one. Apart from it's native functions it can be used to create both Aliases and Popups. And yes also custom Identifiers, things like $cleaninglady(). Cool huh? We'll see more about Identifiers and custom Identifiers later. If you plan to distribute your scripts, I suggest you use Remote to create Aliases and Popups. Let's take a look at the native functions of Remotes. You must have seen or heard about scripts that will automatically voice (mode +v) the people who join the channel. Or those which will close the query window if the text contains www. They are all Remote based: If something happens, then do this or that. As long as the event you specified doesn't take place the commands are not executed. CleaningLady won't clean your room as long as it is clean, she won't feed you as long as you are not hungry, she won't bath you as long as you are not stinking like a Yeti. But at the same time you should have programed her to do the necessary when the condition is true. Remote is a compartively vast topic and a very very interesting one. More about Remotes in the Remotes chapter.
Before I forget, I wanna tell you about comments. Comments are anything else you write in your code you don't mIRC to interpret during execution. You may need to use them in your script to remember which part of the program does what, especially if your program becomes too lenghty and complex. When you look at your codes after some period of time it's usually hard to figure out what's going on. Or maybe to include author and contact information in your script. mIRC v6.12 and later supports two types of comments: ; and /* */. Examples are given below.
Example 1:
; Echo Script v1.0
; Author: Scripter-Boi
; E-mail: scripter-boi@scripter-boi.com
alias /en /echo -a My nick is $me
; EOF
Example 2:/* This is my first super cool program. I have put a lot of effort and time on it.
So I request you not to rip it.
If you like it. You can mail me at scripter-boi@scripter-boi.com
*/
; Echoes the nick
alias /en /echo -a My nick is $me
; Echoes the time
alias /et /echo -a The time is now $time
; EOF
Note: When using single line comments, make sure the comments always preceed the codes. mIRC doesn't support post-code comments like other programming langaguages.